POV-Ray : Newsgroups : povray.newusers : Problems declaring objects : Re: Problems declaring objects Server Time
2 Nov 2024 03:13:22 EDT (-0400)
  Re: Problems declaring objects  
From: Tim Nikias
Date: 15 Sep 2004 09:58:24
Message: <41484a80@news.povray.org>
> With the scale <.25, 1, 1>, how do you calculate the translate <5, 0, 0>?
> If I put scale 5, how can I know the translate vector?

That's actually pretty simple: first, Povray scales the object, afterwards
it translates it to <5,0,0>. Since the sphere is already located at the
origin, the position of the sphere won't change when scaling it. Thus, it
will be squashed a little, but still be positioned at <0,0,0>. So, if I want
to place the sphere at <5,0,0>, I just have to translate it there.

> "for a sphere this is kinda pointless, as you could have placed it at the
> origin from the beginning and thus save translating it back to the
origin:"
> Can you tray to explain me it again, please?

The same as above: positions of objects only change when they are not
centered at the origin, since scaling would not only scale the object, but
also its distance to the origin.
The sphere requires a center vector and a radius. If the center vector is
<0,0,0>, the sphere is sitting right on the origin, and scaling it will only
affect the size.

But, if you place the center of the sphere somewhere else, scaling would
also affect the position/center of the sphere. Hence, we need to move it to
the origin first, scale it, and move it back, if we want to retain its
position, but not its size.

Regards,
Tim

-- 
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.